<template>
<div>
	<content_top title="员工登录日志">
		<div slot="right" style="display: inline-block;float: right;margin-left:5px;">
			<Button @click="$router.back()"><Icon type="ios-arrow-back" size="16" style="margin-right:5px;" />返回</Button>
		</div>
	</content_top>
	
	<div class="menu">
		<ul>
			<li><a @click="$router.push({name:'user_view',params:{id:id}})">用户详情</a></li>
			<li><a @click="$router.push({name:'user_info',params:{id:id}})">编辑资料</a></li>
			<li  class="cur"><a>登录日志</a></li>
		</ul>
	</div>
	
	<div class="g_box">
		<div class="g_head">
			<h3>数据列表</h3>
			
			<!--div class="g_box_right">
				<ButtonGroup class="g_act_box">
					<Button >群发站内信</Button>
					<Button @click="$router.push({name:'user_add'})">新增员工</Button>
				</ButtonGroup>
				<div class="g_other">
					
				</div>
			</div-->
		</div>
		<div class="g_box_con">
			<Table ref="table" :columns="Columns" :data="list" style="width: 100%;" :border="true"></Table>
			<div style="font-size: 14px;overflow: hidden;padding: 10px;">
				<div style="float:left;">
					
				</div>
				<div style="float:right;">
					<Page :total="count" show-elevator show-total @on-change="goto_page" />
				</div>
			</div>
		</div>
	</div>
	
	
</div>
</template>

<script>


export default {
    name: 'user_list',
    data () {
		let self = this;
        return {
            Columns: [
				{
                    title: '时间',
					key: 'addtime',
					width: 300,
					align:'center'
                },
				{
                    title: 'IP',
					key: 'ip',
					width: 300,
					align:'center'
                },
				{
                    title: '地区',
					key: 'region',
					width: 300,
					align:'center'
                },
				{
                    title: '浏览器',
					key: 'device',
					align:'center'
                },
            ],
            list: [],
			count:0,
			page:1,
			id:0
        };
    },
	created(){
		this.id = this.$route.params.id;
		this.load_data();
	},
    computed: {
       
    },
	methods:{
		load_data(){
			var self = this;
			
			var postdata = {
				uid:this.id,
				page:this.page
			}
			
			Whttp.load('User/User/get_log_list',postdata,function(result){
				self.list = result.list;
				self.count = parseInt(result.count);
			});
		},
		goto_page(page){
			this.page = page;
			this.load_data();
		},
		query(){
			this.page = 1;
			this.load_data();
		},
	}
};
</script>
<style scoped>
	@import './info.css';
</style>